<template>
	<div class="xjtuwennav"> 
	<van-tabbar v-model="active">
	  <van-tabbar-item v-for="(item,index) in tuwennav" :key="index" @click="clickTuWen(item.url)" :to="item.purl">
	    <span>{{item.text}}</span>
	    <template #icon="props">
	      <img :src="item.src" v-if="item.src?true:false"/>
		  <!-- <van-icon :name="item.name" :color="item.color" v-if="item.name?true:false" size="2.5rem"/> -->
		  <!-- <i :class="item.class" v-if="item.class?true:false"></i> -->
	    </template>
	  </van-tabbar-item>
	</van-tabbar>
	</div>
</template>

<script>
	export default {
	  props:['tuwennav','prevent'],
	  data() {
	    return {
	      active: 0,
	      // icon: {
	      //  active: require('../../assets/img/user-active.png'),
	      //  inactive: require('../../assets/img/user-inactive.png')
	      // },
	    };
	  },
	  methods:{
        clickTuWen(url){
			  if(this.prevent){
				  return;
			  }
              location.href=url;
		}
	  },
	  created(){
		
	  }
	};
</script>

<style lang="scss" scoped>
	.xjtuwennav{
		margin:10px 0;
		.van-tabbar--fixed{
			position: relative;
			z-index: 0;
			padding: 10px 0;
		}
		.van-tabbar-item__icon img{
			//width: 2rem;
			height: 2.5rem;
		}
	}
</style>